package com.zh.constant;

public interface RequirementConstant {

    /**
     * 需求状态：规划中
     */
    int REQUIREMENT_STATUS_PLANNING = 0;

    /**
     * 需求状态：进行中
     */
    int REQUIREMENT_STATUS_IN_PROGRESS = 1;

    /**
     * 需求状态：暂停中
     */
    int REQUIREMENT_STATUS_PAUSED = 2;

    /**
     * 需求状态：已逾期
     */
    int REQUIREMENT_STATUS_OVERDUE = 3;

    /**
     * 需求状态：已完成
     */
    int REQUIREMENT_STATUS_COMPLETED = 4;
    /**
     * 需求状态：废弃
     */
    int REQUIREMENT_STATUS_DISCARDED = 5;

    static boolean isValidStatus(Integer status) {
        return (null != status) && (status >= REQUIREMENT_STATUS_PLANNING && status <= REQUIREMENT_STATUS_COMPLETED);
    }

    //根据状态获取状态名称
    static String getStatusName(Integer status) {
        switch (status) {
            case REQUIREMENT_STATUS_PLANNING:
                return "规划中";
            case REQUIREMENT_STATUS_IN_PROGRESS:
                return "进行中";
            case REQUIREMENT_STATUS_PAUSED:
                return "暂停中";
            case REQUIREMENT_STATUS_OVERDUE:
                return "已逾期";
            case REQUIREMENT_STATUS_COMPLETED:
                return "已完成";
            case REQUIREMENT_STATUS_DISCARDED:
                return "废弃";
            default:
                return null;
        }
    }
}
